# Contributor: leafduo <leafduo@gmail.com>
# Maintainer : coderoar <coderoar@gmail.com>

arch=('i686' 'x86_64')
conflicts=('qq')
if [[ ${CARCH} = 'x86_64' ]]; then
    depends=('lib32-gtk2>=2.10' 'lib32-glibc>=2.0' 'lib32-cairo' 'lib32-glib2>=2.0' 'lib32-pango>=1.0')
else
    depends=('gtk2>=2.10' 'glibc>=2.0' 'cairo' 'glib2>=2.0' 'pango>=1.0')
fi
license=('custom')
makedepends=('tar')
md5sums=('e269697840f53a8ea8306e600fbd4ed7' '8b58e43f6fb7b6cfe1ada869b18092e6')
pkgdesc='instant messaging software from Tencent Inc.'
pkgname=linuxqq
pkgrel=2
pkgver=1.0.2beta1
provides=('qq')
source=('http://dl_dir.qq.com/linuxqq/linuxqq_v1.0.2-beta1_i386.deb' 'qq.sh')
url='http://im.qq.com/qq/linux/'

build() {
	cd ${srcdir}
	ar vx linuxqq_v1.0.2-beta1_i386.deb || return 1
    tar fxz data.tar.gz || return 1
	if [[ ${CARCH} == 'x86_64' ]]; then
		cp ${srcdir}/qq.sh ${srcdir}/usr/bin/qq || return 1; fi
	install -D -m755 usr/bin/qq ${pkgdir}/usr/bin/qq || return 1
	install -D -m755 usr/share/tencent/qq/qq ${pkgdir}/usr/share/tencent/qq/qq || return 1
	install -D -m644 usr/share/tencent/qq/qq.png ${pkgdir}/usr/share/tencent/qq/qq.png || return 1
	install -D -m644 usr/share/tencent/qq/res.db ${pkgdir}/usr/share/tencent/qq/res.db || return 1
	install -D -m644 usr/share/applications/qq.desktop ${pkgdir}/usr/share/applications/qq.desktop || return 1
	install -D -m644 usr/share/doc/linuxqq/qq ${pkgdir}/usr/share/doc/linuxqq/qq || return 1
}
